#ifndef _STRAWGUI_TEXT_RECT_INTANCE_H_
#define _STRAWGUI_TEXT_RECT_INTANCE_H_

#include "sComponentInstance.h"
#include "sConfig.h"
#include "sComponentRectInstance.h"
#include "sCRITextString.h"
#include <deque>

namespace sgui
{
namespace res
{
	class sComponentRectText;
};
namespace preset
{
	class sFontPreset;
};
namespace inst
{
	class sComponentRectText : public sComponentRectInstance
	{
	private:
		math::sRectf				m_textRect;
		std::wstring				m_text;
		std::deque<sTextString*>	m_strings;

		void updateText();
    protected:
        math::sRectf& getTextRect() { return m_textRect; } 
        const math::sRectf& getTextRect() const { return m_textRect; } 

        const std::deque<sTextString*>& getStrings() const { return m_strings; } 
	public:
		sComponentRectText(const res::sComponentRectText& componentRect, sComponentInstance& instance, s32 id);
		~sComponentRectText();

		void draw(engine::sDrawStack& drawStack) const;
		void update();

		void clear();
		
		bool OnEvent(const obs::sEvent& event);

		const std::wstring& getText() const;
		void setText(const std::wstring& text);

	};

};
};

#endif